// (c) Copyright 2013 Mike Riedel.
// This source is subject to the Microsoft Public License (Ms-PL).
// All other rights reserved.

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FreshMeat.MiniHsmTest
{
   [TestClass]
   public class OvenTest
   {
      [TestMethod]
      public void FullOvenTest()
      {
         var oven = new Oven();

         oven.Update(Oven.Input.OpenedDoor);
         Assert.IsFalse(oven.Heat);
         Assert.IsTrue(oven.Light);

         oven.Update(Oven.Input.ClosedDoor);
         Assert.IsFalse(oven.Heat);
         Assert.IsFalse(oven.Light);

         oven.Update(Oven.Input.PushedStart);
         Assert.IsTrue(oven.Heat);
         Assert.IsTrue(oven.Light);

         oven.Update(Oven.Input.OpenedDoor);
         Assert.IsFalse(oven.Heat);
         Assert.IsTrue(oven.Light);

         oven.Update(Oven.Input.ClosedDoor);
         Assert.IsTrue(oven.Heat);
         Assert.IsTrue(oven.Light);

         oven.Update(Oven.Input.PushedStop);
         Assert.IsFalse(oven.Heat);
         Assert.IsFalse(oven.Light);

         oven.Update(Oven.Input.PushedStop);
         Assert.IsFalse(oven.Heat);
         Assert.IsFalse(oven.Light);
      }
   }
}